module.exports = {
   postFetch:function(url,data,successCallback){
     fetch(URL+'/api/user/login',{
       method: 'POST',
       headers:{
         'Content-Type':'application/json; charset=UTF-8'
       },
       credentials: 'include',
       body:JSON.stringify(data)
     })
     .then((response) => response.text())
     .then((responseText) => {
           let re = JSON.parse(responseText);
           if(re.success){
               // this.browserHistory.push('/app/root');
               successCallback(re);
           }else{
             message.error(re.message);
           }
       })
       .catch((error) => {
         message.error('服务器错误');
       });
   }
}
